package com.zhgxi.zf.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.slave4j.orm.hibernate.BaseEntity;

@Entity
@Table(name = "zf_event")
public class Event extends BaseEntity {

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "uid", nullable = false)
	private User user;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "type_id", nullable = false)
	private EventType eventType;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "did")
	private Dept dept;
	@Column(name = "title", nullable = false, length = 100)
	private String title;
	@Temporal(TemporalType.DATE)
	@Column(name = "etime", nullable = false)
	private Date etime;
	@Column(name = "place", nullable = false, length = 100)
	private String place;
	@Column(name = "descr", length = 65535)
	private String descr;
	@Column(name = "img", length = 200)
	private String img;
	@Column(name = "ispass", nullable = false)
	private Boolean ispass;
	@Column(name = "comment", length = 65535)
	private String comment;
	
	@Temporal(TemporalType.DATE)
	@Column(name = "vtime", nullable = true)
	private Date vtime;

	@Column(name = "isemergency")
	private Boolean isemergency = false;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "viewer", nullable = true)
	private User viewer;

	public Event() {
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public EventType getEventType() {
		return eventType;
	}

	public void setEventType(EventType eventType) {
		this.eventType = eventType;
	}

	public Dept getDept() {
		return dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getEtime() {
		return this.etime;
	}

	public void setEtime(Date etime) {
		this.etime = etime;
	}

	public String getPlace() {
		return this.place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	public String getDescr() {
		return this.descr;
	}

	public void setDescr(String descr) {
		this.descr = descr;
	}

	public String getImg() {
		return this.img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public Boolean getIspass() {
		return this.ispass;
	}

	public void setIspass(Boolean ispass) {
		this.ispass = ispass;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Boolean getIsemergency() {
		return this.isemergency;
	}

	public void setIsemergency(Boolean isemergency) {
		this.isemergency = isemergency;
	}

	public User getViewer() {
		return viewer;
	}

	public void setViewer(User viewer) {
		this.viewer = viewer;
	}

	public Date getVtime() {
		return vtime;
	}

	public void setVtime(Date vtime) {
		this.vtime = vtime;
	}

}